package com.autoMobile.servlet;

import com.autoMobile.bean.ddmUser;
import com.autoMobile.dao.ddmUserDao;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;




@WebServlet("/ddm/shenqing")
public class shenqingServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
  
    public shenqingServlet() {
       
    }

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//接收用户请求参数
		
				//调用dao层 操作数据库
				ddmUserDao dao =new ddmUserDao();
				List<ddmUser> list=dao.ListUsers();
				request.setAttribute("list", list);
				System.out.println(list.toString());
				//控制转向
				request.getRequestDispatcher("/employee/listUser.jsp").forward(request, response);
			}
	}


